<{include file="../modules/_manager/header.html" title='ユーザー'}>

<script src="<{$ROOTPATH}>/_manager/scripts/vars/admin.js.php"></script>
<script> jQuery(function($){admin.init();}); </script>

<{function menu level=0 data=1}>
	<{foreach $data as $entry}>
		<{if $entry.adminId == $login_adminId}>
			<tr class="sel nline">
		<{else}>
			<{if $level mod 2 ==  0}>
				<tr class="iteration">
			<{else}>
				<tr>
			<{/if}>
		<{/if}>
			<td class="lvl">
				<{$entry.levelname}>
			</td>
			<td class="lid nline">
				<{if $login_levelno  gt 85 or $login_adminId eq $entry.adminId}>
					<{$entry.loginId}>
				<{else}>
					-
				<{/if}>
			</td>
			<td class="nam nline">
				<{$entry.name}>
			</td>
			<td class="mob nline">
				<{if $login_levelno  gt 79 or $login_adminId eq $entry.adminId or $login_rootAdmin eq $entry.adminId}>
					<{$entry.mobile}>
				<{else}>
					-
				<{/if}>
			</td>
			<td class="qq nline">
				<{$entry.qq}>
			</td>
			<td class="eml">
				<{$entry.email}>
			</td>
			<td class="ck nline">
				<{if $entry.checker == 1}>
					審査者
				<{else}>
					-
				<{/if}>
			</td>
			<td class="ed nline">
				<{if $login_adminId == 1}>
					<a class="typeLink" onclick="admin.todo(<{$entry.adminId}>,0)">編集</a>
				<{else}>
					<{if $entry.adminId == $login_adminId}>
						<a class="typeLink" onclick="admin.todo(<{$entry.adminId}>,0)">編集</a>
					<{else}>
						-
					<{/if}>
				<{/if}>
			</td>
			<td class="dl nline">
				<{if $entry.adminId == 1}>
					<img src="<{$ROOTPATH}>/images/sys/icon-caution.png" title="管理者削除禁止" />
				<{else}>
					<{if $login_adminId == 1}>
						<a class="typeLink" 
							onclick="blockDesign.message( $(admin.deladmin_form._name),'382px');
							$('#delete_admin_id').val('<{$entry.adminId}>');">削除</a>
					<{else}>
						-
					<{/if}>
				<{/if}>
				<input type="hidden" value="<{$entry.name}>" id="admin_name_hidden_<{$entry.adminId}>">
				<input type="hidden" value="<{$entry.mobile}>" id="admin_mobile_hidden_<{$entry.adminId}>">
				<input type="hidden" value="<{$entry.qq}>" id="admin_qq_hidden_<{$entry.adminId}>">
				<input type="hidden" value="<{$entry.email}>" id="admin_email_hidden_<{$entry.adminId}>">
				<input type="hidden" value="<{$entry.level}>" id="admin_level_hidden_<{$entry.adminId}>">
				<input type="hidden" value="<{$entry.loginId}>" id="admin_loginId_hidden_<{$entry.adminId}>">
			</td>
		</tr>
		<{if isset($admin_list[$entry.adminId])}>
		<tr>
			<td colspan="9" class="tre">
				<table class="sub_tree">
					<tbody class="listitem">
						<{menu data=$admin_list[$entry.adminId] level=$level+1}>
					</tbody>
				</table>
			</td>
		</tr>
		<{/if}>
	<{/foreach}>
<{/function}>



<div class="block">
<h1>スタッフ管理ページ</h1>
<h2>合计:<{$len}>人</h2>
<table class="table_list">
	<thead class="listitem">
		<tr class="header">
			<td>
				レベル
			</td>
			<td>
				ログイン名
			</td>
			<td>
				お名前
			</td>
			<td>
				携帯
			</td>
			<td>
				QQ
			</td>
			<td>
				Email
			</td>
			<td>
				審査
			</td>
			<td>
				編集
			</td>
			<td>
				削除
			</td>
		</tr>
	</thead>
	<tbody class="listitem">
		<{if $login_adminId == 1}>
			<{menu data=$admin_list[$login_rootAdmin]}>
		<{else}>
			<{menu data=$admin_list[1]}>
		<{/if}>
	</tbody>
</table>
</div>

<div id="new_form" class="new_form" style="display:none;">
        <div id="new_form_title">
            ユーザ新規作成する
        </div>
        <table>
            <tr>
                <td>
                    ログインID：
                </td>
                <td>
                    <input type="text" id="admin_loginId_text" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    お名前：
                </td>
                <td>
                    <input type="text" id="admin_name_text" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    携帯電話：
                </td>
                <td>
                    <input type="text" id="admin_mobile_text" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    QQ：
                </td>
                <td>
                    <input type="text" id="admin_qq_text" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    email：
                </td>
                <td>
                    <input type="text" id="admin_email_text" />
                </td>
                <td>
                </td>
            </tr>
            <tr id="admin_level_tr">
                <td>
                    等级：
                </td>
                <td>
                    <select id="admin_level_text" style="width: 100px">
                    	<{foreach $level_listview as $entry}>
	                        <option value="<{$entry.levelId}>"><{$entry.name}></option>
                        <{/foreach}>
                    </select>
                    <input type="hidden" id="admin_level_hidden" value="0">
                </td>
                <td>
                </td>
            </tr>
            <tr id="admin_old_pwd_tr">
                <td>
                    old Password:
                </td>
                <td>
                    <input type="password" id="admin_passwdold_text" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    Password:
                </td>
                <td>
                    <input type="password" id="admin_passwd_text" />
                    <input type="hidden" id="admin_passwd_update_type_hidden" value="0">
                    <a class="typeLink" id="admin_passwd_change_link" onclick="admin.passwd_change()">パスワード変更</a>
                	<a class="typeLink" id="admin_passwd_no_change_link" onclick="admin.passwd_no_change()">取り消し</a>
                </td>
                <td>
                </td>
            </tr>
            <tr id="admin_re_pwd_tr">
                <td>
                    Re Password:
                </td>
                <td>
                    <input type="password" id="admin_passwd1_text" />
                </td>
                <td>
                </td>
            </tr>
        </table>
        <a class="typeLink" id="newadmin_form_ok" onclick="if($(admin.new_form.adminId).val() == 0){
	 admin.add(); }else{admin.update();}">新規作成</a> <a class="typeLink" onclick="$.unblockUI();">
         Close</a>
        <input type="hidden" id="admin_adminId_hidden" value="0">
</div>
<{if $login_adminId == 1}>
<div id="deladmin_form" class="new_form" style="display: none;">
    <div>
        業者様を削除されます。<br />
        削除しますか？
    </div>
    <div>
        <a class="typeLink" onclick="admin.todo(-1,1)">削除する</a> <a class="typeLink" onclick="$.unblockUI();">
            キャンセル</a>
    </div>
    <input type="hidden" id="delete_admin_id" value="" />
</div>
<{/if}>

<{include file="../modules/_manager/footer.html"}>